//查找字母a出现的次数
let arr = ['b', 'a', 'c', 'a', 'g', 'j', 'a', 'c', 'b'];
let m = 'a';
let count = 0;
for (let i = 0; i < arr.length; i++) {
    if (m === arr[i]) {
        count++;
    }
}
document.write(count + '次');